function once(fn) {
  // 如何给js添加自定义事件,EventEmitter, once
  let done = false
  // fn.apply()
  return function () {
    if (!done) {
      done = true
      return fn.apply(this, arguments);
    }
  }
}

let fn = once(() => {
  console.log('once');
})

fn();
fn()

